FROM openjdk:8
COPY kafka_2.11-2.3.0 /kafka

ENV KAFKA_NUM_NETWORK_THREADS=3 \
	KAFKA_NUM_IO_THREADS=8 \
	KAFKA_SOCKET_SEND_BUFFER_BYTES=102400 \
	KAFKA_SOCKET_RECEIVE_BUFFER_BYTES=102400 \
	KAFKA_SOCKET_REQUEST_MAX_BYTES=104857600 \
	KAFKA_LOG_DIRS=/tmp/kafka-logs \
	KAFKA_NUM_PARTITIONS=1 \
	KAFKA_NUM_RECOVERY_THREADS_PER_DATA_DIR=1 \
	KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 \
	KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR=1 \
	KAFKA_TRANSACTION_STATE_LOG_MIN_ISR=1 \
	KAFKA_LOG_FLUSH_INTERVAL_MESSAGES=10000 \
	KAFKA_LOG_FLUSH_INTERVAL_MS=1000 \
	KAFKA_LOG_RETENTION_HOURS=168 \
	KAFKA_LOG_RETENTION_BYTES=1073741824 \
	KAFKA_LOG_SEGMENT_BYTES=1073741824 \
	KAFKA_LOG_RETENTION_CHECK_INTERVAL_MS=300000 \
	KAFKA_ZOOKEEPER_CONNECT=localhost:2181 \
	KAFKA_ZOOKEEPER_CONNECTION.TIMEOUT.MS=6000
#	KAFKA_BROKER_ID= \
#	KAFKA_LISTENERS=PLAINTEXT://:9092 \
#	KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://your.host.name:9092 \
#	KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT,SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL 


ENV PATH=/kafka/bin:$PATH

COPY docker-entrypoint.sh /

WORKDIR /kafka

ENTRYPOINT ["/bin/sh", "/docker-entrypoint.sh"]

CMD ["bin/kafka-server-start.sh", "config/server.properties"]


